<?php

Raise::load('RaiseDateTimeComponentComparator');

class RaiseTimeComparator extends RaiseDateTimeComponentComparator {
    
    /**
     * Compares two RaiseTime objects
     * @param RaiseTime $time1 First time to compare
     * @param RaiseTime $time2 Second time to compare
     * @return integer Return 0 if both time are equal, 1 if $time2 > $time1 and -1 if $time2 < $time1
     */
    public function compare($time1, $time2) {
        $components = array('hour', 'minute', 'second', 'millisecond');
        return $this->compareComponents($time1, $time2, $components);
    }
    
}